import {createBrowserRouter} from 'react-router-dom'
import { lazy } from 'react'
import App from '../App'

const Data = lazy(()=>import('@/pages/data/Index'))
const Data1 = lazy(()=>import('@/pages/data1/Index'))

type homeRouter = {
    path:string;
    element:JSX.Element;
    children:{path:string;element:JSX.Element;}[]
}[]

const routes:homeRouter = [
    {
        path:'/',
        element:<App></App>,
        children:[
            {
                path:"/data",
                element:<Data></Data>
            },
            {
                path:"/data1",
                element:<Data1></Data1>
            },
        ]
    }
]

const router = createBrowserRouter(routes)

export default router